/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Arrays;

/**
 * <p>Project: jse2204 - Reg5
 * <p>Powered by webrx On 2022-09-14 14:25:58
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Reg5 {
    public static void main(String[] args) {
        System.out.println("hello123".replace("\\d",""));

        //删除字符串中的数字 \d [0-9]
        System.out.println("-0.16h23ello123".replaceAll("\\d",""));

        //? {0,1} 0个或1个 * {0,} 有0个或多个  + {1,} 最少有一个1个或多个
        // . 代表1个任意符号
        System.out.println(".5666-0.16h23ello123-67abc-0.500".replaceAll("-?\\d*\\.?\\d+",""));
        System.out.println("aaaaaaaaaaaaaaaaaaaaaaaa".matches("a*"));
        System.out.println("".matches("a{0,}"));
        System.out.println("aaaaa".matches("a{0,}"));
        System.out.println("aaaaaaaaaaaaa".matches("a{5,12}"));
        System.out.println("aaabbc".matches("[a-h]{6}"));
        System.out.println("123java4mysql56javascript".replaceFirst("\\d+",""));
        System.out.println("123java4mysql56javascript".replaceAll("\\d+",""));
        System.out.println(Arrays.toString("java3html5242php3python".split("\\d+")));
        System.out.println();

        //是否全匹配英文字母
        System.out.println("Hello,Java程序设计".matches("[a-zA-Z]+"));

        System.out.println("Hello,Java程序设计".replaceAll(",|[\u4e00-\u9fa5]+","").matches("[a-zA-Z]+"));
        System.out.println("Hello,Java程序设计".replaceAll("[^a-zA-Z]","").matches("[a-zA-Z]+"));
        System.out.println("Hello,Java程序设计".replaceAll("[^a-zA-Z]",""));
        System.out.println("HelloJava".matches("[a-zA-Z]+"));
        //有没有英文字母
        System.out.println("Hello,Java程序设计".matches(".*[a-zA-Z]+.*"));
    }
}
